﻿using KPIS.GERP.Models.Class;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization;

namespace KPIS.GERP.Models.ICM
{
    [DataContract, Table("IcmAssetDepreciation")]
    public class AssetDepreciation
    {
        public AssetDepreciation()
        {
        }

        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [DataMember]
        public int AssetDepId { get; set; }

        [ForeignKey("Asset")]
        [CustomRequired]
        [DataMember]
        public int AssetId { get; set; }

        [CustomRequired]
        [DataMember]
        public DateTime CalculatedDate { get; set; }

        [CustomRequired]
        [DataMember]
        public decimal DepAmount { get; set; }

        [ForeignKey("TransectionGroup")]
        [DataMember]
        public int? TranGrpId { get; set; }

        [StringLength(2)]
        [DataMember, Display(Name = "RecordStatus", ResourceType = typeof(Resources.AssetResource))]
        public string RecordStatus { get; set; }

        [DataMember, Display(Name = "CreatedBy", ResourceType = typeof(Resources.AssetResource))]
        public int CreatedBy { get; set; }

        [DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(Resources.AssetResource))]
        public System.DateTime? CreatedWhen { get; set; }

        [DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(Resources.AssetResource))]
        public Nullable<int> UpdatedBy { get; set; }

        [DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(Resources.AssetResource))]
        public Nullable<System.DateTime> UpdatedWhen { get; set; }

        [DataMember]
        public virtual Asset Asset { get; set; }

        [DataMember]
        public virtual ACM.TransectionGroup TransectionGroup { get; set; }
    }
}
